function [] = bar_plot(data,sem,name,titlename, xlabelname, ylabelname)
% 画出各种类别下带有SEM方差带的柱状图
%---input---
%data：输入数据，size1小类，size2大类
%sem：
%name: 横轴标签，与大类数目保持一致，实例：name = categorical({'S1','S2','S3','S4','S5','S6','Avg'});

figure;
%绘制条形图，没有轮廓
b = bar(name,data,'EdgeColor','none');
%绘制SEM
hold on;
for i = 1:length(b)
    for j = 1:length(b(i).XData)
        X = b(i).XEndPoints(j);
        Y = b(i).YEndPoints(j);
        Yp = (Y - sem(i,j)):0.01:(Y + sem(i,j));
        Xp = ones(length(Yp),1) * X;
        plot(Xp,Yp,'linewidth',3,'color','#000000');
    end
end
%配颜色，添加图例，加粗线形
Colormap = {'#A45D5D','#E49795','#00C7FE','#005B8F'};
for t = 1:length(b)
    b(t).FaceColor = Colormap{t};
end
legend('static','yaw','pitch');
title(titlename);
xlabel(xlabelname);
ylabel(ylabelname);
set(gca, 'linewidth', 2, 'fontsize', 20, 'fontname', 'times');
end

